import { Injectable } from '@angular/core';
import {API_URL_USER} from '../providers/Constants';
import { HttpService } from "./HttpService";


@Injectable()
export class UserService {
  constructor(
    private httpService: HttpService,

  ) { }

  login(user) {
    var url = API_URL_USER+"/login.do";
    return this.httpService.httpPost(url, user);
  }
  regiseter(user){

    var url = API_URL_USER+"/register.do"

    return this.httpService.httpPost(url,user);
  }
  getUserInfo(id){
    var url = API_URL_USER+"/getUserInfo?id="+id;
    return this.httpService.httpGet(url);
  }
  updatInfo(userInfo){
    var url = API_URL_USER+"/update"
    return this.httpService.httpPost(url,userInfo);
  }

  selectJoinSportPerson(sportId){
    var url = API_URL_USER+"/selectJoinSportPerson?sportId="+sportId;
    return this.httpService.httpGet(url);
  }

}
